package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.manager.service.SysRoleUserService;
import com.atguigu.spzx.model.dto.system.AssignRoleDto;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name="用户角色管理")
@RestController
@RequestMapping("/admin/system/userRole")
public class SysRoleUserController {

    @Autowired
    SysRoleUserService sysRoleUserService;

    @Operation(summary = "给用户分配角色")
    @PutMapping("/doAssign")
    public Result doAssign(@RequestBody AssignRoleDto assginRoleDto){
        sysRoleUserService.doAssign(assginRoleDto);
        return Result.build(null, ResultCodeEnum.SUCCESS);
    }
}
